<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改设备')"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-equipment-edit" th:object="${equipment}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">用户ID：</label>
            <div class="col-sm-8">
                <input name="userId" th:field="*{userId}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">sim卡号：</label>
            <div class="col-sm-8">
                <input name="sim" th:field="*{sim}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">设备名称：</label>
            <div class="col-sm-8">
                <input name="name" th:field="*{name}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">经度：</label>
            <div class="col-sm-8">
                <input name="longitude" th:field="*{longitude}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">纬度：</label>
            <div class="col-sm-8">
                <input name="latitude" th:field="*{latitude}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">雷达限速：</label>
            <div class="col-sm-8">
                <input name="speedLimit" th:field="*{speedLimit}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">电池电压：</label>
            <div class="col-sm-8">
                <input name="voltage" th:field="*{voltage}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">工作模式：</label>
            <div class="col-sm-8">
                <select name="workPattern" class="form-control m-b">
                    <option value="">所有</option>
                </select>
                <span class="help-block m-b-none"><i
                        class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">子工作模式：</label>
            <div class="col-sm-8">
                <select name="workSubPattern" class="form-control m-b">
                    <option value="">所有</option>
                </select>
                <span class="help-block m-b-none"><i
                        class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">时间模式：</label>
            <div class="col-sm-8">
                <select name="timePattern" class="form-control m-b">
                    <option value="">所有</option>
                </select>
                <span class="help-block m-b-none"><i
                        class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">开始时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="startTime"
                           th:value="${#dates.format(equipment.startTime, 'yyyy-MM-dd')}"
                           class="form-control"
                           placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">结束时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="endTime"
                           th:value="${#dates.format(equipment.endTime, 'yyyy-MM-dd')}"
                           class="form-control"
                           placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">亮度：</label>
            <div class="col-sm-8">
                <input name="brightness" th:field="*{brightness}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">频率：</label>
            <div class="col-sm-8">
                <input name="frequency" th:field="*{frequency}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">尾迹：</label>
            <div class="col-sm-8">
                <input name="wake" th:field="*{wake}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">道路id：</label>
            <div class="col-sm-8">
                <input name="roadId" th:field="*{roadId}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">状态(0在线 1 离线)：</label>
            <div class="col-sm-8">
                <select name="state" class="form-control m-b">
                    <option value="">所有</option>
                </select>
                <span class="help-block m-b-none"><i
                        class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">能见度：</label>
            <div class="col-sm-8">
                <input name="visibility" th:field="*{visibility}" class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<div class="row">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i
                class="fa fa-check"></i>保 存
        </button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i
                class="fa fa-reply-all"></i>关 闭
        </button>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">
    var prefix = ctx + "equipment/equipment";
    $("#form-equipment-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-equipment-edit').serialize());
        }
    }

    $("input[name='startTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='endTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>